import java.security.Key;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;

public class e {
    private Cipher decryptCipher;
    private Cipher encryptCipher;
    private static String strDefaultKey;

    static {
        e.strDefaultKey = "national";
    }

    public e(String arg9) {
        e v0 = this;
        v0.encryptCipher = null;
        v0.decryptCipher = null;
        e v5 = v0;
        String v6 = arg9;
        try {
            Key v2 = v5.getKey(v6.getBytes());
            v0.encryptCipher = Cipher.getInstance("DES");
            v0.encryptCipher.init(1, v2);
            v0.decryptCipher = Cipher.getInstance("DES");
            v0.decryptCipher.init(2, v2);
        }
        catch(Exception v5_1) {
            v5_1.printStackTrace();
        }
    }

    public e() throws Exception {
        this(e.strDefaultKey);
    }

    public static String byteArr2HexStr(byte[] arg11) throws Exception {
        byte[] v0 = arg11;
        int v1 = v0.length;
        StringBuffer v2 = new StringBuffer(v1 * 2);
        int v3;
        for(v3 = 0; v3 < v1; ++v3) {
            int v4;
            for(v4 = v0[v3]; v4 < 0; v4 += 0x100) {
            }

            if(v4 < 16) {
                v2.append('0');
            }

            v2.append(Integer.toString(v4, 16));
        }

        return v2.toString();
    }

    public String decrypt(String arg9) throws Exception {
        return new String(this.decrypt(e.hexStr2ByteArr(arg9)));
    }

    public byte[] decrypt(byte[] arg6) throws Exception {
        return this.decryptCipher.doFinal(arg6);
    }

    public String encrypt(String arg6) throws Exception {
        return e.byteArr2HexStr(this.encrypt(arg6.getBytes()));
    }

    public byte[] encrypt(byte[] arg6) throws Exception {
        return this.encryptCipher.doFinal(arg6);
    }

    private Key getKey(byte[] arg11) throws Exception {
        byte[] v1 = arg11;
        byte[] v2 = new byte[8];
        int v3;
        for(v3 = 0; v3 < v1.length; ++v3) {
            if(v3 >= v2.length) {
                break;
            }

            v2[v3] = v1[v3];
        }

        return new SecretKeySpec(v2, "DES");
    }

    public static final String get草泥马(String arg14) {
        CharSequence v1 = arg14.subSequence(0, 25);
        CharSequence v2 = v1.subSequence(0, 1);
        CharSequence v3 = v1.subSequence(1, 2);
        return new String(arg14.replaceAll((String) v1, "").replaceAll((String) v2, "l").replaceAll((String) v3, "z").replaceAll("l", (String) v3).replaceAll("z", (String) v2));
    }

    public static byte[] hexStr2ByteArr(String arg13) throws Exception {
        byte[] v1 = arg13.getBytes();
        int v2 = v1.length;
        byte[] v3 = new byte[v2 / 2];
        int v4;
        for(v4 = 0; v4 < v2; v4 += 2) {
            v3[v4 / 2] = ((byte)Integer.parseInt(new String(v1, v4, 2), 16));
        }

        return v3;
    }
}

